﻿package mortal.game.view.rebate.item
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class RebateTabSCellSp extends RebateTabBaseCell
    {
        protected var _bg:GBitmap;
        protected var _title:GTextFiled;
        protected var _hasReward:ScaleSwfPlayer;
        protected var _canGetFlag:GBitmap;
        private static var titleArr:Object = {0:"" + Language.getString(71783), 1:"" + Language.getString(71784), 2:"" + Language.getString(71785), 3:"" + Language.getString(71786), 4:"" + Language.getString(71787)};

        public function RebateTabSCellSp()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg = UIFactory.gBitmap(ImagesConst.AchievemenListTabBtnBg, 0, 0, this);
            this._title = UIFactory.gTextField("", 0, 18, 160, 30, this, GlobalStyle.textFormatPutong.setColor(16777215).setSize(16).center().setBold(true));
            this._canGetFlag = UIFactory.gBitmap(ImagesConst.ItemGetIcon, 1, 2, this);
            this._title.mouseEnabled = false;
            this.mouseEnabled = true;
            this._canGetFlag.visible = false;
            return;
        }// end function

        override public function setData(param1) : void
        {
            var _loc_2:* = int(param1);
            if (_loc_2 == 2)
            {
                this._title.text = Cache.instance.openServerSevenDay.getTargetTypeName() + Language.getString(71788);
            }
            else
            {
                this._title.text = "" + titleArr[_loc_2];
            }
            return;
        }// end function

        public function setRewardFlag(param1:Boolean) : void
        {
            if (param1)
            {
                if (this._hasReward == null)
                {
                    this._hasReward = UICompomentPool.getUICompoment(ScaleSwfPlayer);
                    this._hasReward.swf.timeRate = 5;
                    this._hasReward.scaleX = 0.85;
                    this._hasReward.scaleY = 0.8;
                    this._hasReward.load("guide_noName.swf", ModelType.NormalSwf, null);
                    this._hasReward.move(93, 35);
                    this.addChild(this._hasReward);
                }
                this._hasReward.visible = true;
                this._hasReward.swf.play();
                this._canGetFlag.visible = true;
            }
            else if (this._hasReward)
            {
                this._hasReward.visible = false;
                this._hasReward.swf.stop();
                this._canGetFlag.visible = false;
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._bg.dispose(param1);
            this._title.dispose(param1);
            this._bg = null;
            this._title = null;
            this._canGetFlag = null;
            if (this._hasReward)
            {
                this._hasReward.dispose(param1);
                this._hasReward = null;
            }
            return;
        }// end function

    }
}
